<div class="inmodal">
    <div class="modal-header">
        <h4 class="modal-title">{{'USER.CHANGE_PASSWORD' | translate}}</h4>
    </div>
    <div class="modal-body">
        <form role="form" name="form_changepwd" novalidate class="form-horizontal">
            <div class="form-group"><label class="col-sm-4 control-label">{{'USER.USERNAME' | translate}}</label>
                <div class="col-sm-8">
                    <input ng-model="user.name" type="text" class="form-control" readonly=""></div>
            </div>
            <div class="hr-line-dashed"></div>

            <div class="form-group"><label class="col-sm-4 control-label">{{'USER.OLD_PASSWORD' | translate}}</label>
                <div class="col-sm-8">
                    <input ng-model="user.old_password" type="password" name="old_password" class="form-control" required="">
                    <div class="m-t-xs" ng-show="form_changepwd.old_password.$invalid && form_changepwd.old_password.$dirty">
                        <small class="text-danger" ng-show="form_changepwd.old_password.$error.required">{{'USER.INPUT_PASSWORD' | translate}}</small>
                    </div>
                </div>
            </div>

            <div class="form-group"><label class="col-sm-4 control-label">{{'USER.NEW_PASSWORD' | translate}}</label>
                <div class="col-sm-8">
                    <input ng-model="user.new_password" type="password" name="new_password" class="form-control" required="">
                    <div class="m-t-xs" ng-show="form_changepwd.new_password.$invalid && form_changepwd.new_password.$dirty">
                        <small class="text-danger" ng-show="form_changepwd.new_password.$error.required">{{'USER.INPUT_PASSWORD' | translate}}</small>
                    </div>
                </div>
            </div>

            <div class="form-group"><label class="col-sm-4 control-label">{{'USER.CONFIRM_PASSWORD' | translate}}</label>
                <div class="col-sm-8">
                    <input ng-model="user.confirm_new_password" type="password" name="confirm_new_password" class="form-control" required="">
                    <div class="m-t-xs" ng-show="form_changepwd.confirm_new_password.$invalid && form_changepwd.confirm_new_password.$dirty">
                        <small class="text-danger" ng-show="form_changepwd.confirm_new_password.$error.required">{{'USER.INPUT_PASSWORD' | translate}}</small>
                    </div>
                    <div class="m-t-xs" ng-show="form_changepwd.confirm_new_password.$modelValue !== form_changepwd.new_password.$modelValue">
                        <small class="text-danger" >{{'USER.DIFF_PASSWORD' | translate}}</small>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-white" ng-click="cancel()">{{'SETTING.CANCEL' | translate}}</button>
        <button type="button" ng-disabled="form_changepwd.$invalid || form_changepwd.usercpwd.$modelValue !== form_changepwd.userpwd.$modelValue" class="btn btn-primary" ng-click="ok()">{{'SETTING.SAVE' | translate}}</button>
    </div>
</div>
